using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using BubzCommerce.CMS.Data.BusinessObjects;
using BubzCommerce.CMS.Data.Base;

namespace BubzCommerce.CMS.Data.ManagerObjects
{
    public partial interface IUploadManager : IManagerBase<BubzCommerce.CMS.Data.BusinessObjects.Upload, int>
    {
		// Get Methods
		IList<Upload> GetByParentID(System.Int32 uploadMember);
    }

    partial class UploadManager : ManagerBase<BubzCommerce.CMS.Data.BusinessObjects.Upload, int>, IUploadManager
    {
		#region Constructors
		
		public UploadManager() : base()
        {
        }
        public UploadManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Upload> GetByParentID(System.Int32 uploadMember)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Upload));
			
			
			ICriteria uploadMemberCriteria = criteria.CreateCriteria("UploadMember");
            uploadMemberCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", uploadMember));
			
			return criteria.List<Upload>();
        }
		
		#endregion
    }
}